import Vue from 'vue'
import Router from 'vue-router'
import WrjHome from '@/components/WrjHome'
import Content from "@/components/Content";
import Home from "@/components/Home";
import Login from "@/views/Login";
import NotFound from "@/views/NotFound";
import Main from "@/views/Main"
import MemberList from "@/views/Member/MemberList";
import MemberLevel from "@/views/Member/MemberLevel";
import WrjOne from "@/views/sddc/WrjOne";
import WrjTwo from "@/views/sddc/WrjTwo";
import WrjThree from "@/views/sddc/WrjThree";
import WrjFour from "@/views/sddc/WrjFour";
import WrjFive from "@/views/sddc/WrjFive";
import WrjSix from "@/views/sddc/WrjSix";
import WrjSeven from "@/views/sddc/WrjSeven";

// 使用vue-router
Vue.use(Router)

export default new Router({
  // hash模式（带#）和历史模式
  mode: 'history',
  routes: [
    {
      // 跳转路径
      path: '/content',
      // 路由名称
      name: 'Content',
      // 路由跳转组件
      component: Content
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/wrjHome',
      name: 'WrjHome',
      component: WrjHome,
      // 子路由
      children:[
        {
          path: '/wrj',
          name: 'WrjOne',
          component: WrjOne
        },
        {
          path: '/wrj/two',
          name: 'WrjTwo',
          component: WrjTwo
        },
        {
          path: '/wrj/three',
          name: 'WrjThree',
          component: WrjThree
        },
        {
          path: '/wrj/four',
          name: 'WrjFour',
          component: WrjFour
        },
        {
          path: '/wrj/five',
          name: 'WrjFive',
          component: WrjFive
        },
        {
          path: '/wrj/six',
          name: 'WrjSix',
          component: WrjSix
        },
        {
          path: '/wrj/seven',
          name: 'WrjSeven',
          component: WrjSeven
        },
      ]
    },
      // 登录页面
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '*',
      component: NotFound
    },
      // 登录成功主页面
    {
      path: '/main',
      name: 'Main',
      component: Main,
      // 子路由
      children:[
        {
          path: '/member/list',
          name: 'MemberList',
          component: MemberList
        },
        {
          path: '/member/level/:id',
          name: 'MemberLevel',
          component: MemberLevel,
          props: true
        }
      ]
    },
      // 回到首页
    {
      path: '/goMain',
      redirect: '/main'
    },
  ]
})
